import QtQuick 2.1
import QtQuick.Controls 1.0
import QtQuick.Window 2.0
import QtQuick.Dialogs 1.0
import QtQuick.XmlListModel 2.0
import QtQuick.Controls.Styles 1.0


Rectangle {

    id: paneCharacterEdit
    color: "lightsteelblue"

    Item {
        anchors.fill: parent
        anchors.margins: 6

        Text {
            id: textEditTitle
            text: "Character Class"
            color: "white"
            anchors.top: parent.top
            anchors.left: parent.left
            anchors.right: parent.right
            font.pixelSize: 16
            font.bold: true
        }

        Column {
            id: columnCharacterName
            anchors.top: textEditTitle.bottom
            anchors.left: parent.left
            anchors.right: parent.right
            anchors.margins: 2
            anchors.topMargin: 8
            spacing: 6

            Text {
                text: "Name"

                color: "white"
                font.bold: true;
            }

            Rectangle {
                anchors.left: parent.left
                anchors.right: parent.right
                height: 20

                color: "white"

                TextInput {
                    text: modelCharacterClasses.get(editIndex).className
                    anchors.fill: parent
                    verticalAlignment: TextInput.AlignVCenter
                    anchors.margins: 3
                }
            }
        }

        Column {
            id: columnHitDie
            anchors.top: columnCharacterName.bottom
            anchors.left: parent.left
            anchors.right: parent.right
            anchors.margins: 2
            anchors.topMargin: 8
            spacing: 6

            Text {
                text: "Hit Die"

                color: "white"
                font.bold: true;
            }

            ComboBox {
                model: modelHitDice
                anchors.left: parent.left
                anchors.right: parent.right
                currentIndex: modelCharacterClasss.get(editIndex).classHitDie

                onCurrentIndexChanged: {
                        /// \todo Replace XmlListModel with real data model, since XmlListModel is read only!
                        /// \author Jussi
                        /// \date 2013-10-11
                }
            }
        }

        Column {
            id: columnSkillPoints
            anchors.top: columnHitDie.bottom
            anchors.left: parent.left
            anchors.right: parent.right
            anchors.margins: 2
            anchors.topMargin: 8
            spacing: 6

            Text {
                text: "Skill Points"

                color: "white"
                font.bold: true;
            }

            ComboBox {
                model: modelSkillPoints
                textRole: "skillPointName"
                anchors.left: parent.left
                anchors.right: parent.right
                currentIndex: modelCharacters.count > 0 ? modelCharacterClasss.get(editIndex).classSkillPoints : 0

                onCurrentIndexChanged: {
                        /// \todo Replace XmlListModel with real data model, since XmlListModel is read only!
                        /// \author Jussi
                        /// \date 2013-10-11
                }
            }
        }

        Column {
            id: columnBaseAttack
            anchors.top: columnSkillPoints.bottom
            anchors.left: parent.left
            anchors.right: parent.right
            anchors.margins: 2
            anchors.topMargin: 8
            spacing: 6

            Text {
                text: "Base Attack Bonus"

                color: "white"
                font.bold: true;
            }

            ComboBox {
                model: modelBaseBonus
                textRole: "baseBonusName"
                anchors.left: parent.left
                anchors.right: parent.right
                currentIndex: modelCharacters.count > 0 ? modelCharacterClasss.get(editIndex).classBaseAttack : 0

                onCurrentIndexChanged: {
                        /// \todo Replace XmlListModel with real data model, since XmlListModel is read only!
                        /// \author Jussi
                        /// \date 2013-10-11
                }
            }
        }

        Column {
            id: columnFortSave
            anchors.top: columnBaseAttack.bottom
            anchors.left: parent.left
            anchors.right: parent.right
            anchors.margins: 2
            anchors.topMargin: 8
            spacing: 6

            Text {
                text: "Fortitude Save"

                color: "white"
                font.bold: true;
            }

            ComboBox {
                model: modelSaveBonus
                textRole: "saveBonusName"
                anchors.left: parent.left
                anchors.right: parent.right
                currentIndex: modelCharacters.count > 0 ? modelCharacterClasss.get(editIndex).classBaseAttack : 0

                onCurrentIndexChanged: {
                        /// \todo Replace XmlListModel with real data model, since XmlListModel is read only!
                        /// \author Jussi
                        /// \date 2013-10-11
                }
            }
        }

        Column {
            id: columnRefSave
            anchors.top: columnFortSave.bottom
            anchors.left: parent.left
            anchors.right: parent.right
            anchors.margins: 2
            anchors.topMargin: 8
            spacing: 6

            Text {
                text: "Reflex Save"

                color: "white"
                font.bold: true;
            }

            ComboBox {
                model: modelSaveBonus
                textRole: "saveBonusName"
                anchors.left: parent.left
                anchors.right: parent.right
                currentIndex: modelCharacters.count > 0 ? modelCharacterClasss.get(editIndex).classBaseAttack : 0

                onCurrentIndexChanged: {
                        /// \todo Replace XmlListModel with real data model, since XmlListModel is read only!
                        /// \author Jussi
                        /// \date 2013-10-11
                }
            }
        }

        Column {
            id: columnWillSave
            anchors.top: columnRefSave.bottom
            anchors.left: parent.left
            anchors.right: parent.right
            anchors.margins: 2
            anchors.topMargin: 8
            spacing: 6

            Text {
                text: "Willpower Save"

                color: "white"
                font.bold: true;
            }

            ComboBox {
                model: modelSaveBonus
                textRole: "saveBonusName"
                anchors.left: parent.left
                anchors.right: parent.right
                currentIndex: modelCharacters.count > 0 ? modelCharacterClasss.get(editIndex).classBaseAttack : 0

                onCurrentIndexChanged: {
                        /// \todo Replace XmlListModel with real data model, since XmlListModel is read only!
                        /// \author Jussi
                        /// \date 2013-10-11
                }
            }
        }
        /*
        Item {
            id: columnClassSkills
            anchors.top: columnSkillPoints.bottom
            anchors.left: parent.left
            anchors.right: parent.right
            anchors.bottom: parent.bottom
            anchors.margins: 2
            anchors.topMargin: 8

//            ComponentButton {
//                id: panelMenuButtonClassSkills
//                text: scrollViewClassSkills.visible ? "Hide" : "Show"
//                onClicked: scrollViewClassSkills.visible = !scrollViewClassSkills.visible
//                anchors.top: parent.top
//                anchors.right: parent.right
//                anchors.left: undefined
//                horizontalAlignment: Text.AlignHCenter
//                width: 50
//            }

            Text {
                id: textClassSkillsTitle
//                anchors.verticalCenter: panelMenuButtonClassSkills.verticalCenter
                anchors.left: parent.left
//                anchors.right: panelMenuButtonClassSkills.left

                text: "Class Skills"

                color: "white"
                font.bold: true;
            }


        } // columnClassSkills
        */
    }

}
